home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / programer2 / pari2 / pari / other / pari_txt < prev    next >
Lisp/Scheme  |  1991-04-22  |  9KB  |  225 lines

  1.  
  2.                Some Notes on pari-mode
  3.                =======================
  4.  
  5.  
  6. pari-mode runs pari-gp as a sub process of (gnu-)emacs.
  7.  
  8. INSTALATION.
  9. ===========
  10.  
  11. pari-mode consists of three files: pari.txt, pari.el and pari.menu.
  12.  
  13. 1) pari.menu should be placed in any convenient directory, and pari.el
  14.    edited accordingly (see below).
  15.  
  16. 2) pari.el should be installed in a directory in your EMACSLOADPATH.
  17.    At the top of the file five constants are declared.
  18.    gp-chap3, gp-dvi-preview, gp-man-dvi, gp-file-name, gp-menu
  19.    These declarations must be edited to refer to the pathnames
  20.    of the relevant files at your site.
  21.  
  22.    pari.el should then by byte-compiled (using M-x byte-compile-file in
  23.    emacs). This should produce a compiled version pari.elc.
  24.  
  25. 3) pari.txt (this file) is for information only.
  26.  
  27.  
  28. USE
  29. ===
  30.  
  31. To use pari-mode, users should add the following two lines to their .emacs
  32.  
  33. (autoload 'gp "pari" " pari-gp" t)
  34. (autoload 'gpman "pari" " pari-gp manual" t)
  35.  
  36. Or alternatively, if you always want pari to be loaded, just add the line
  37.  
  38. (load "pari" nil t)
  39.  
  40. In either case, three new commands are made available.
  41.  
  42. M-x gp     This starts up the pari-gp process in a new buffer,  *PARI*.
  43. C-u M-x gp The same as M-x gp, but  prompts for the command line arguments.
  44. M-x gpman  This starts up a dvi previewer with the PARI-GP manual.
  45.  
  46.  
  47.  
  48. ===========================================================================
  49.  
  50. PARI-MODE
  51. =========
  52.  
  53. Inside the buffer *PARI*, the following extra commands are available.
  54.  
  55.  KEY       LISP-NAME             DESCRIPTION
  56.  ===       =========             ===========
  57. RET      gp-send-input         Copy current expression to the end,
  58.                                   and send to gp.
  59. M-RET    gp-copy-input         Copy current expression to the end.
  60. M-?      gp-get-man-entry      Display the manual entry for a gp command.
  61. M-\ p    gp-set-prompt         Set the gp prompt.
  62. M-\ c    gp-help-menu          Menu driven help. (Uses the file pari.menu.)
  63. M-\ t    gp-meta-t       \
  64. M-\ d    gp-meta-d        |                                 
  65.  
  66. M-\ r    gp-meta-r        |        
  67. M-\ w    gp-meta-w        |    Versions of the gp meta-commands, which    
  68. M-\ v    gp-meta-v         \   prompt for arguments in the mini-buffer
  69. M-\ x    gp-meta-x         /   and display output in the help buffer.
  70. M-\ s    gp-meta-s        |    
  71. M-\ b    gp-meta-b        |        
  72. M-\ k    gp-meta-k        |       
  73. M-\ q    gp-meta-q       /        
  74. M-\ \    gp-break-long-line    Break a long line at col. 100, inserting \.
  75.  
  76. Note that most of these commands use the emacs meta key.
  77. This may be marked `left' `right' `extended character'  `<>'
  78. or various other markings. If your keyboard has not got a meta key. You
  79. can use the escape key as a prefix.
  80.  
  81. Thus M-\ corresponds to pressing meta and \ together, or pressing 
  82. ESC followed by \ .
  83.  
  84. ===========================================================================
  85.  
  86. RET
  87. ===
  88. If point is after the last gp-prompt,  pressing RET sends current gp
  89. expression to the gp process. If point is at some previous expression, this
  90. expression (which may be several lines long) is copied to the end of the
  91. buffer and then executed.
  92.  
  93. M-RET
  94. =====
  95. M-RET, acts like RET, except that the expression is not sent to the gp
  96. process. It is just copied to the end, so that it may be edited, and then
  97. RET pressed, to send the new expression to gp.
  98.  
  99. M-?
  100. ===
  101. M-? prompts for the name of a gp command (which may include symbolic names
  102. like +). It then finds the appropriate paragraphs of section 3 of the
  103. manual, strips off some of the TeX commands, and displays the result in a
  104. new window. If the command is not found in the manual, sends ?command to
  105. gp, and displays the output in the help window. Thus M-? also works with
  106. user-defined commands.
  107.  
  108. M-\ p
  109. =====
  110. M-\ p prompts for a new string in the mini-buffer. The command
  111. \prompt=<new string>
  112. is then sent to gp, so that gp will now prompt for input with <new string>.
  113. The variable gp-prompt-string is also reset so that RET and M-RET, know
  114. that gp expressions now start with <new string>. Expressions typed to the
  115. old prompt are still recognised.
  116.  
  117. M-\ c
  118. =====
  119. This shows a menu of subject headings. Pressing RET selects the menu of
  120. commands for that heading. Pressing RET by one of the commands displays the
  121. manual entry for that command, as if M-? command had been typed.
  122. (Instructions are displayed in the mini-buffer.)
  123.  
  124. M-\ \
  125. =====
  126. If the line is longer than 100, a \<newline> is inserted every 100 characters.
  127. This is necessary if the line is longer than 256 characters as gp can not accept
  128. line longer than this. M-\ \ moves point to the end of the current line.
  129.  
  130. M-\ 
  131. ===
  132. The other comands on the M-\ prefix send the appropriate meta command to
  133. gp. However they use the mini-buffer to read arguments (eg so that you can
  134. use filename completion) and display any output in the *gp-help* buffer.
  135.  
  136. ===========================================================================
  137.  
  138. Notes
  139. =====
  140.  
  141. 1) You may edit previous expressions, and then type RET to send them to gp.
  142.    However if you want the *PARI* buffer to contain a script of a valid gp
  143.    session, you may prefer to use M-RET to copy the expression to the end
  144.    of the buffer, before editing it.
  145.  
  146. 2) M-\ c is supposed to be a version of the gp meta comand \c, although
  147.    it does not send \c to gp.
  148.    M-\ p does not correspond to the gp meta command \p but rather to the
  149.    command \prompt=  . If this disturbs you it is easy enough to bind
  150.    M-\ p to a command that inserts \p into the *PARI* buffer. 
  151.    The command gp-set-prompt can then be bound to any key sequence that
  152.    you wish. 
  153.    All the other commands on the M-\ prefix do work by sending a gp meta
  154.    command to the *PARI* buffer.
  155.  
  156. 3) The menu of commands produced by M-\ c is contained in the file
  157.    pari.menu. The functions do not assume any particular grouping of the gp
  158.    functions into sections. Also the same gp command can appear in more
  159.    than one section ( ^ already appears in two sections). The format of the
  160.    file should be clear, and it can easily be edited to suit your
  161.    requirements. 
  162.    There should be no blank lines at the beginning, and the file should end
  163.    with a line just containing ###.
  164.    The pari.menu file distributed is based on the table of contents of the
  165.    user manual. 
  166.  
  167. 4) gp-mode-hook.
  168.    Individual users can customise gp-mode without having to make copies of
  169.    the file pari.el.
  170.    In your .emacs define a gp-mode-hook, this will be run by the gp command.
  171.    The format is:
  172.  
  173.        (setq gp-mode-hook 
  174.          (function (lambda ()
  175.        < list of commands to run when starting up gp >
  176.         )))
  177.  
  178.    An example is:
  179.  
  180.        (setq gp-mode-hook 
  181.          (function (lambda ()
  182.            (define-key gp-map "\M-\\p" 'gp-meta-p)
  183.            (define-key gp-map "\M-p" 'gp-set-prompt)
  184.            (setq gp-stack-size "1000000")
  185.            (setq gp-prime-limit "2000")
  186.            (setq gp-menu "my-menu")
  187.        )))
  188.  
  189.   This: 
  190.         Binds a function which sends \p to gp (which would need to be defined
  191.              somewhere else), to M-\ p.
  192.         Binds gp-set-prompt to M-p.
  193.         Defines the default stack size and prime limit as 10000 and 2000.
  194.         Defines the menu file to be my-menu rather than the file pari.menu.
  195.  
  196. 5) Command line arguments.
  197.    The gp executable file is specified in the variable gp-file-name. This
  198.    is set in the file pari.el, but users can override this setting, either
  199.    in their gp-mode-hook, or by using the C-u prefix to gp. In either case,
  200.    the full path name need not be given if gp is in a directory specified
  201.    in your PATH variable (or the equivalent in csh).
  202.    The variables gp-stack-size, gp-buffer-size and gp-prime-limit should be
  203.    set to strings specifying the arguments to gp. See the above example.
  204.  
  205.  
  206.    If these variables are  set to "", then the appropriate flags 
  207.       "-s", "-b" or "-p" are *not* sent to gp. 
  208.    If RET is typed in response to any of the prompts produced by C-u M-x gp
  209.       then the default value, ie., the value of gp-file-name, gp-stack-size,
  210.        gp-buffer-size or gp-prime-limit, is assumed. 
  211.    If a space is sent to the prompt (ie SPC RET) then the appropriate argument
  212.        is not  sent to gp, even if the default is non-empty.
  213.  
  214.    Developers of pari-gp, and others who often use different settings for
  215.    these arguments, may like to add the line
  216.    (setq gp-prompt-for-args t)
  217.    to their gp-mode-hook. Setting this variable to a non-nil value such as t
  218.    makes M-x gp act like C-u M-x gp.
  219.  
  220. ===========================================================================
  221.  
  222.   David Carlisle
  223.  
  224.         22/4/91  ( This file refers to pari.el version 2.8 )
  225.